<div class="maintop">
    当前位置：代理等级管理
    <a href="javascript:;" action="<?=$basepath?>_add" class="mainFrame button icon-plus">添加代理等级</a>
    <a href="javascript:;" action="<?=$basepath?>" class="mainFrame button">刷新</a>
    <? if(ISDEBUG){ ?>
        <a href="javascript:$('.debuginfo').toggle();" class="button">调试信息</a>
    <? } ?>
    <a href="/cache/update?keys=game_agent_level_" class="button" target="ajax" func="loadpage">更新缓存</a>
</div>
<div class="main-search">
    <table width="100%">
        <tbody><tr>
            <td>
                <form action="<?=$basepath?>" id="SearchForm" method="get" target="ajax" dataType="html" onajax="beforeSearchForm" call="searchForm" container="#iframe" isLoad="true">
                    <input type="text" id="sKey" name="sKey" class="int" placeholder="搜索关键字">
                    每页：
                    <select id="ps" name="ps">
                        <option value="12" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 12) echo 'selected';?> >12</option>
                        <option value="20" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 20) echo 'selected';?> >20</option>
                        <option value="30" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 30) echo 'selected';?> >30</option>
                        <option value="50" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 50) echo 'selected';?> >50</option>
                        <option value="100" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 100) echo 'selected';?> >100</option>
                    </select>
                    <input type="submit" value="搜索" class="upbutton">
                    <input action="<?=$basepath?>_delete_list" type="button" id="deleteSelectId" value="删除选择" class="upbutton">
                </form>
            </td>
        </tr>
        </tbody>

    </table>
</div>
<div id="mainbody">
    <table width="100%" class="tablist">
        <tr class="trbg"><th width="30"><input id="selectAllid" type="checkbox" value="1" /></th>
            <th>等级编号</th>
            <th>名称</th>
            <th>返水总额</th>
            <th>充值折返</th>
            <th>返点</th>
            <th>每推荐一人奖励</th>
            <th>晋级奖励</th>
            <th width="60">操作</th></tr>
        <? foreach($datas as $v){ ?>
            <tr>
                <td width="30"><input type="checkbox" name="selectValue" value="<?=$v['lid']?>" /></td>
                <td><?=$v['lid']?></td>
                <td><?=$v['title']?></td>
                <td>≥ <?=$v['backtotal']?> <?=$this->currencyName?></td>
                <td><?=$v['rechargediscd']?>%</td>
                <td><?=$v['backposion']?>%</td>
                <td><?=$v['pushusergive']?> <?=$this->currencyName?></td>
                <td><?=$v['promotionaward']?> <?=$this->currencyName?></td>
                <td>
                    <a action="<?=$basepath?>_delete?lid=<?=$v['lid']?>" title="删除" class="mainFrame button icon-trash-2" href="javascript:;"></a>
                    <a action="<?=$basepath?>_edit?lid=<?=$v['lid']?>" title="编辑" class="mainFrame button icon-edit" href="javascript:;"></a>
                </td>
            </tr>
        <? } ?>
    </table>
    <? require VIEW.'/page.view.php' ?>
</div>
<script type="text/javascript">
    function beforeSearchForm(){

    }
    function searchForm(self, _html, data){
        $("#iframe").html(_html);
    }
    $(document).ready(function(){
        <?php
        if(!empty($searchdata['usergroup'])){
            echo '$("#usergroup option[value='.$searchdata['usergroup'].']").attr("selected", "selected");';
        }
        ?>
    });
</script>
